import request from '@/api/request/index'
import type {
  PoIdDto,
  CaiGouDanQuXiaoZhiDing,
  FaHuoXinXi,
  LogisticsDto,
  DingDanFaHuodto,
  JiChuLongListQingQiudto,
  CaiGouDingDanXiangQing,
  PageDataCaiGouDingDanChaXunTiaoJian,
  CaiGouDingDanChaXunTiaoJian_1,
  skuXiuGaiQingQiuTi
} from './_interfaces.ts'

/** 回签合同删除 */
export function poManageBackContractDelete(data: PoIdDto): Promise<any> {
  return request.post('/api/poManage/backContractDelete', data)
}

/** 回签合同上传 */
export function poManageBackContractUpload(data?: any): Promise<any> {
  return request.post('/api/poManage/backContractUpload', data)
}

/** 取消置顶 */
export function poManageCancelIsTop(data: CaiGouDanQuXiaoZhiDing): Promise<any> {
  return request.post('/api/poManage/cancelIsTop', data)
}

/** 发货物流单号修改查询 */
export function poManageDeliveryExpressQuery(data: LogisticsDto): Promise<FaHuoXinXi> {
  return request.post('/api/poManage/deliveryExpressQuery', data)
}

/** 发货前图片上传-小程序专用 */
export function poManageDeliveryFileUpload(data?: any): Promise<string> {
  return request.post('/api/poManage/deliveryFileUpload', data)
}

/** 订单sku发货 */
export function poManageDoDeliveryPo(data?: any): Promise<string> {
  return request.post('/api/poManage/doDeliveryPo', data)
}

/** 订单sku发货(批量) */
export function poManageDoDeliveryPoBatch(data?: any): Promise<any> {
  return request.post('/api/poManage/doDeliveryPoBatch', data)
}

/** 订单sku发货-小程序 */
export function poManageDoDeliveryPoByWx(data: DingDanFaHuodto): Promise<any> {
  return request.post('/api/poManage/doDeliveryPoByWx', data)
}

/** 打印标签 */
export function poManageLabelPrinting(data: { skuCodes?: string[] }): Promise<string> {
  return request.get('/api/poManage/labelPrinting', data)
}

/** 物流单号修改 */
export function poManageModificationLogisticsNumber(data?: any): Promise<any> {
  return request.post('/api/poManage/modificationLogisticsNumber', data)
}

/** SKU无货处理 */
export function poManageOutOfStockHandling(data: string[]): Promise<any> {
  return request.post('/api/poManage/outOfStockHandling', data)
}

/** 查询多个订单的sku信息 */
export function poManageQueryMultiPoSku(data: JiChuLongListQingQiudto): Promise<any> {
  return request.post('/api/poManage/queryMultiPoSku', data)
}

/** 组织名称列表 */
export function poManageQueryPoDemandSide(): Promise<any> {
  return request.get('/api/poManage/queryPoDemandSide')
}

/** 查询订单详情 */
export function poManageQueryPoDetail(data: { id?: string }): Promise<CaiGouDingDanXiangQing> {
  return request.get('/api/poManage/queryPoDetail', data)
}

/** 查询订单信息列表 */
export function poManageQueryPoInfo(data: CaiGouDingDanChaXunTiaoJian_1): Promise<PageDataCaiGouDingDanChaXunTiaoJian> {
  return request.post('/api/poManage/queryPoInfo', data)
}

/** 查询采购订单发货包裹总数 */
export function poManageQueryPoPackageCount(data: { poId?: string }): Promise<number> {
  return request.get('/api/poManage/queryPoPackageCount', data)
}

/** 查询订单下的sku信息 */
export function poManageQueryPoSku(data: { noCancelSku?: boolean; poId?: string }): Promise<any> {
  return request.get('/api/poManage/queryPoSku', data)
}

/** 查询采购订单数据状态总数 */
export function poManageQueryPoStateCount(data: CaiGouDingDanChaXunTiaoJian_1): Promise<any> {
  return request.post('/api/poManage/queryPoStateCount', data)
}

/** 查询收货地址(仓库)信息 */
export function poManageQueryPoStoreNames(): Promise<any> {
  return request.get('/api/poManage/queryPoStoreNames')
}

/** 修改订单sku */
export function poManageUpdatePoSku(data: skuXiuGaiQingQiuTi): Promise<any> {
  return request.post('/api/poManage/updatePoSku', data)
}
